
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module mpsse</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>mpsse</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/lib/python2.6/dist-packages/mpsse.py">/usr/lib/python2.6/dist-packages/mpsse.py</a><br><a href="http://docs.python.org/library/mpsse">Module Docs</a></font></td></tr></table>
    <p></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="pylibmpsse.html">pylibmpsse</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="mpsse.html#MPSSE">MPSSE</a>
</font></dt></dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="MPSSE">class <strong>MPSSE</strong></a></font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Python&nbsp;class&nbsp;wrapper&nbsp;for&nbsp;libmpsse.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>

<dl><dt><a name="MPSSE-__init__"><strong>__init__</strong></a>(self, mode<font color="#909090">=None</font>, frequency<font color="#909090">=100000</font>, endianess<font color="#909090">=0</font>)</dt><dd><tt>Class&nbsp;constructor.<br>
&nbsp;<br>
@mode&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;The&nbsp;<a href="#MPSSE">MPSSE</a>&nbsp;mode&nbsp;to&nbsp;use,&nbsp;one&nbsp;of:&nbsp;SPI0,&nbsp;SPI1,&nbsp;SPI2,&nbsp;SPI3,&nbsp;I2C,&nbsp;GPIO,&nbsp;BITBANG,&nbsp;None.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;None,&nbsp;no&nbsp;attempt&nbsp;will&nbsp;be&nbsp;made&nbsp;to&nbsp;connect&nbsp;to&nbsp;the&nbsp;FTDI&nbsp;chip.&nbsp;Use&nbsp;this&nbsp;if&nbsp;you&nbsp;want&nbsp;to&nbsp;call&nbsp;the&nbsp;Open&nbsp;method&nbsp;manually.<br>
@frequency&nbsp;-&nbsp;The&nbsp;frequency&nbsp;to&nbsp;use&nbsp;for&nbsp;the&nbsp;specified&nbsp;serial&nbsp;protocol,&nbsp;in&nbsp;hertz&nbsp;(default:&nbsp;100KHz).<br>
@endianess&nbsp;-&nbsp;The&nbsp;endianess&nbsp;of&nbsp;data&nbsp;transfers,&nbsp;one&nbsp;of:&nbsp;MSB,&nbsp;LSB&nbsp;(default:&nbsp;MSB).<br>
&nbsp;<br>
Returns&nbsp;None.</tt></dd></dl>

<dl><dt><a name="MPSSE-Open"><strong>Open</strong></a>(self, vid, pid, mode, frequency<font color="#909090">=100000</font>, endianess<font color="#909090">=0</font>, interface<font color="#909090">=1</font>, description<font color="#909090">=None</font>, serial<font color="#909090">=None</font>, index<font color="#909090">=0</font>)</dt><dd><tt>Opens&nbsp;the&nbsp;specified&nbsp;FTDI&nbsp;device.<br>
Called&nbsp;internally&nbsp;by&nbsp;__init__&nbsp;if&nbsp;the&nbsp;__init__&nbsp;mode&nbsp;is&nbsp;not&nbsp;None.<br>
&nbsp;<br>
@vid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;FTDI&nbsp;USB&nbsp;vendor&nbsp;ID.<br>
@pid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;FTDI&nbsp;USB&nbsp;product&nbsp;ID.<br>
@mode&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;The&nbsp;<a href="#MPSSE">MPSSE</a>&nbsp;mode&nbsp;to&nbsp;use,&nbsp;one&nbsp;of:&nbsp;SPI0,&nbsp;SPI1,&nbsp;SPI2,&nbsp;SPI3,&nbsp;I2C,&nbsp;GPIO,&nbsp;BITBANG.<br>
@frequency&nbsp;&nbsp;&nbsp;-&nbsp;The&nbsp;frequency&nbsp;to&nbsp;use&nbsp;for&nbsp;the&nbsp;specified&nbsp;serial&nbsp;protocol,&nbsp;in&nbsp;hertz&nbsp;(default:&nbsp;100KHz).<br>
@endianess&nbsp;&nbsp;&nbsp;-&nbsp;The&nbsp;endianess&nbsp;of&nbsp;data&nbsp;transfers,&nbsp;one&nbsp;of:&nbsp;MSB,&nbsp;LSB&nbsp;(default:&nbsp;MSB).<br>
@interface&nbsp;&nbsp;&nbsp;-&nbsp;The&nbsp;interface&nbsp;to&nbsp;use&nbsp;on&nbsp;the&nbsp;FTDI&nbsp;chip,&nbsp;one&nbsp;of:&nbsp;IFACE_A,&nbsp;IFACE_B,&nbsp;IFACE_C,&nbsp;IFACE_D,&nbsp;IFACE_ANY&nbsp;(default:&nbsp;IFACE_A).<br>
@description&nbsp;-&nbsp;FTDI&nbsp;device&nbsp;product&nbsp;description&nbsp;(default:&nbsp;None).<br>
@serial&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;FTDI&nbsp;device&nbsp;serial&nbsp;number&nbsp;(default:&nbsp;None).<br>
@index&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;Number&nbsp;of&nbsp;matching&nbsp;device&nbsp;to&nbsp;open&nbsp;if&nbsp;there&nbsp;are&nbsp;more&nbsp;than&nbsp;one,&nbsp;starts&nbsp;with&nbsp;zero&nbsp;(default:&nbsp;0).<br>
&nbsp;<br>
Returns&nbsp;MPSSE_OK&nbsp;on&nbsp;success.<br>
Raises&nbsp;an&nbsp;exeption&nbsp;on&nbsp;failure.</tt></dd></dl>

<dl><dt><a name="MPSSE-Close"><strong>Close</strong></a>(self)</dt><dd><tt>Closes&nbsp;the&nbsp;FTDI&nbsp;device&nbsp;connection,&nbsp;deinitializes&nbsp;libftdi,&nbsp;and&nbsp;frees&nbsp;the&nbsp;libmpsse&nbsp;context.<br>
&nbsp;<br>
Returns&nbsp;None.</tt></dd></dl>

<dl><dt><a name="MPSSE-EnableBitmode"><strong>EnableBitmode</strong></a>(self, tf)</dt><dd><tt>Enables/disables&nbsp;bitwise&nbsp;data&nbsp;transfers.<br>
Called&nbsp;internally&nbsp;by&nbsp;ReadBits&nbsp;and&nbsp;WriteBites.<br>
&nbsp;<br>
@tf&nbsp;-&nbsp;Set&nbsp;to&nbsp;1&nbsp;to&nbsp;enable&nbsp;bitwise&nbsp;transfers,&nbsp;0&nbsp;to&nbsp;disable.<br>
&nbsp;<br>
Returns&nbsp;None.</tt></dd></dl>

<dl><dt><a name="MPSSE-ErrorString"><strong>ErrorString</strong></a>(self)</dt><dd><tt>Returns&nbsp;the&nbsp;last&nbsp;libftdi&nbsp;error&nbsp;string.</tt></dd></dl>

<dl><dt><a name="MPSSE-FlushAfterRead"><strong>FlushAfterRead</strong></a>(self, tf)</dt><dd><tt>Enables&nbsp;/&nbsp;disables&nbsp;the&nbsp;explicit&nbsp;flushing&nbsp;of&nbsp;the&nbsp;recieve&nbsp;buffer&nbsp;after&nbsp;each&nbsp;read&nbsp;operation.<br>
&nbsp;<br>
@tf&nbsp;-&nbsp;Set&nbsp;to&nbsp;1&nbsp;to&nbsp;enable&nbsp;flushing,&nbsp;0&nbsp;to&nbsp;disable&nbsp;(disabled&nbsp;by&nbsp;default).<br>
&nbsp;<br>
Returns&nbsp;None.</tt></dd></dl>

<dl><dt><a name="MPSSE-GetAck"><strong>GetAck</strong></a>(self)</dt><dd><tt>Returns&nbsp;the&nbsp;last&nbsp;received&nbsp;ACK&nbsp;bit.<br>
&nbsp;<br>
Returns&nbsp;one&nbsp;of:&nbsp;ACK,&nbsp;NACK.</tt></dd></dl>

<dl><dt><a name="MPSSE-GetClock"><strong>GetClock</strong></a>(self)</dt><dd><tt>Returns&nbsp;the&nbsp;currently&nbsp;configured&nbsp;clock&nbsp;rate,&nbsp;in&nbsp;hertz.</tt></dd></dl>

<dl><dt><a name="MPSSE-GetDescription"><strong>GetDescription</strong></a>(self)</dt><dd><tt>Returns&nbsp;the&nbsp;description&nbsp;of&nbsp;the&nbsp;FTDI&nbsp;chip,&nbsp;if&nbsp;any.&nbsp;<br>
This&nbsp;will&nbsp;only&nbsp;be&nbsp;populated&nbsp;if&nbsp;__init__&nbsp;was&nbsp;used&nbsp;to&nbsp;open&nbsp;the&nbsp;device.</tt></dd></dl>

<dl><dt><a name="MPSSE-GetPid"><strong>GetPid</strong></a>(self)</dt><dd><tt>Returns&nbsp;the&nbsp;product&nbsp;ID&nbsp;of&nbsp;the&nbsp;FTDI&nbsp;chip.</tt></dd></dl>

<dl><dt><a name="MPSSE-GetVid"><strong>GetVid</strong></a>(self)</dt><dd><tt>Returns&nbsp;the&nbsp;vendor&nbsp;ID&nbsp;of&nbsp;the&nbsp;FTDI&nbsp;chip.</tt></dd></dl>

<dl><dt><a name="MPSSE-PinHigh"><strong>PinHigh</strong></a>(self, pin)</dt><dd><tt>Sets&nbsp;the&nbsp;specified&nbsp;GPIO&nbsp;pin&nbsp;high.<br>
&nbsp;<br>
@pin&nbsp;-&nbsp;Pin&nbsp;number&nbsp;0&nbsp;-&nbsp;11&nbsp;in&nbsp;GPIO&nbsp;mode.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;In&nbsp;all&nbsp;other&nbsp;modes,&nbsp;one&nbsp;of:&nbsp;GPIOL0,&nbsp;GPIOL1,&nbsp;GPIOL2,&nbsp;GPIOL3,&nbsp;GPIOH0,&nbsp;GPIOH1,&nbsp;GPIOH2,&nbsp;GPIOH3,&nbsp;GPIOH4,&nbsp;GPIOH5,&nbsp;GPIOH6,&nbsp;GPIOH7.<br>
&nbsp;<br>
Returns&nbsp;MPSSE_OK&nbsp;on&nbsp;success.<br>
Raises&nbsp;an&nbsp;exception&nbsp;on&nbsp;failure.</tt></dd></dl>

<dl><dt><a name="MPSSE-PinLow"><strong>PinLow</strong></a>(self, pin)</dt><dd><tt>Sets&nbsp;the&nbsp;specified&nbsp;GPIO&nbsp;pin&nbsp;low.<br>
&nbsp;<br>
@pin&nbsp;-&nbsp;Pin&nbsp;number&nbsp;0&nbsp;-&nbsp;11&nbsp;in&nbsp;GPIO&nbsp;mode.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;In&nbsp;all&nbsp;other&nbsp;modes,&nbsp;one&nbsp;of:&nbsp;GPIOL0,&nbsp;GPIOL1,&nbsp;GPIOL2,&nbsp;GPIOL3,&nbsp;GPIOH0,&nbsp;GPIOH1,&nbsp;GPIOH2,&nbsp;GPIOH3,&nbsp;GPIOH4,&nbsp;GPIOH5,&nbsp;GPIOH6,&nbsp;GPIOH7.<br>
&nbsp;<br>
Returns&nbsp;MPSSE_OK&nbsp;on&nbsp;success.<br>
Raises&nbsp;an&nbsp;exception&nbsp;on&nbsp;failure.</tt></dd></dl>

<dl><dt><a name="MPSSE-PinState"><strong>PinState</strong></a>(self, pin, state<font color="#909090">=-1</font>)</dt><dd><tt>Checks&nbsp;the&nbsp;current&nbsp;state&nbsp;of&nbsp;the&nbsp;pins.<br>
For&nbsp;use&nbsp;in&nbsp;BITBANG&nbsp;mode&nbsp;only.<br>
&nbsp;<br>
@pin&nbsp;&nbsp;&nbsp;-&nbsp;The&nbsp;pin&nbsp;number&nbsp;whose&nbsp;state&nbsp;you&nbsp;want&nbsp;to&nbsp;check.&nbsp;<br>
@state&nbsp;-&nbsp;The&nbsp;value&nbsp;returned&nbsp;by&nbsp;ReadPins.&nbsp;If&nbsp;not&nbsp;specified,&nbsp;ReadPins&nbsp;will&nbsp;be&nbsp;called&nbsp;automatically.<br>
&nbsp;<br>
Returns&nbsp;a&nbsp;1&nbsp;if&nbsp;the&nbsp;pin&nbsp;is&nbsp;high,&nbsp;0&nbsp;if&nbsp;the&nbsp;pin&nbsp;is&nbsp;low.</tt></dd></dl>

<dl><dt><a name="MPSSE-Read"><strong>Read</strong></a>(self, size)</dt><dd><tt>Reads&nbsp;bytes&nbsp;over&nbsp;the&nbsp;selected&nbsp;serial&nbsp;protocol.<br>
&nbsp;<br>
@size&nbsp;-&nbsp;Number&nbsp;of&nbsp;bytes&nbsp;to&nbsp;read.<br>
&nbsp;<br>
Returns&nbsp;a&nbsp;string&nbsp;of&nbsp;size&nbsp;bytes.</tt></dd></dl>

<dl><dt><a name="MPSSE-ReadBits"><strong>ReadBits</strong></a>(self, n)</dt><dd><tt>Performs&nbsp;a&nbsp;bitwise&nbsp;read&nbsp;of&nbsp;up&nbsp;to&nbsp;8&nbsp;bits&nbsp;at&nbsp;a&nbsp;time.<br>
&nbsp;<br>
@n&nbsp;-&nbsp;Number&nbsp;of&nbsp;bits&nbsp;to&nbsp;read.<br>
&nbsp;<br>
Returns&nbsp;an&nbsp;integer&nbsp;value&nbsp;with&nbsp;the&nbsp;read&nbsp;bits&nbsp;set.</tt></dd></dl>

<dl><dt><a name="MPSSE-ReadPins"><strong>ReadPins</strong></a>(self)</dt><dd><tt>Reads&nbsp;the&nbsp;current&nbsp;state&nbsp;of&nbsp;the&nbsp;chip's&nbsp;pins.<br>
For&nbsp;use&nbsp;in&nbsp;BITBANG&nbsp;mode&nbsp;only.<br>
&nbsp;<br>
Returns&nbsp;an&nbsp;integer&nbsp;with&nbsp;the&nbsp;corresponding&nbsp;pin's&nbsp;bits&nbsp;set.</tt></dd></dl>

<dl><dt><a name="MPSSE-SendAcks"><strong>SendAcks</strong></a>(self)</dt><dd><tt>Causes&nbsp;all&nbsp;subsequent&nbsp;I2C&nbsp;read&nbsp;operations&nbsp;to&nbsp;respond&nbsp;with&nbsp;an&nbsp;acknowledgement.<br>
&nbsp;<br>
Returns&nbsp;None.</tt></dd></dl>

<dl><dt><a name="MPSSE-SendNacks"><strong>SendNacks</strong></a>(self)</dt><dd><tt>Causes&nbsp;all&nbsp;subsequent&nbsp;I2C&nbsp;read&nbsp;operations&nbsp;to&nbsp;respond&nbsp;with&nbsp;a&nbsp;no-acknowledgement.<br>
&nbsp;<br>
Returns&nbsp;None.</tt></dd></dl>

<dl><dt><a name="MPSSE-SetAck"><strong>SetAck</strong></a>(self, ack)</dt><dd><tt>Sets&nbsp;the&nbsp;transmitted&nbsp;ACK&nbsp;bit.<br>
For&nbsp;use&nbsp;only&nbsp;in&nbsp;I2C&nbsp;mode.<br>
&nbsp;<br>
@ack&nbsp;-&nbsp;One&nbsp;of:&nbsp;ACK,&nbsp;NACK.<br>
&nbsp;<br>
Returns&nbsp;None.</tt></dd></dl>

<dl><dt><a name="MPSSE-SetCSIdle"><strong>SetCSIdle</strong></a>(self, idle)</dt><dd><tt>Sets&nbsp;the&nbsp;idle&nbsp;state&nbsp;of&nbsp;the&nbsp;chip&nbsp;select&nbsp;pin.<br>
&nbsp;<br>
@idle&nbsp;-&nbsp;Set&nbsp;to&nbsp;1&nbsp;to&nbsp;idle&nbsp;high,&nbsp;0&nbsp;to&nbsp;idle&nbsp;low&nbsp;(CS&nbsp;idles&nbsp;high&nbsp;by&nbsp;default).<br>
&nbsp;<br>
Returns&nbsp;None.</tt></dd></dl>

<dl><dt><a name="MPSSE-SetClock"><strong>SetClock</strong></a>(self, frequency)</dt><dd><tt>Sets&nbsp;the&nbsp;appropriate&nbsp;divisor&nbsp;for&nbsp;the&nbsp;desired&nbsp;clock&nbsp;frequency.<br>
Called&nbsp;internally&nbsp;by&nbsp;__init__&nbsp;and&nbsp;Open.<br>
&nbsp;<br>
@frequency&nbsp;-&nbsp;The&nbsp;desired&nbsp;clock&nbsp;frequency,&nbsp;in&nbsp;hertz.<br>
&nbsp;<br>
Returns&nbsp;MPSSE_OK&nbsp;on&nbsp;success.<br>
Raises&nbsp;an&nbsp;exception&nbsp;on&nbsp;failure.</tt></dd></dl>

<dl><dt><a name="MPSSE-SetDirection"><strong>SetDirection</strong></a>(self, direction)</dt><dd><tt>Sets&nbsp;the&nbsp;input/output&nbsp;direction&nbsp;of&nbsp;pins&nbsp;as&nbsp;determined&nbsp;by&nbsp;direction&nbsp;(1&nbsp;=&nbsp;Output,&nbsp;0&nbsp;=&nbsp;Input).&nbsp;<br>
For&nbsp;use&nbsp;in&nbsp;BITBANG&nbsp;mode&nbsp;only.<br>
&nbsp;<br>
@direction&nbsp;-&nbsp;&nbsp;Byte&nbsp;indicating&nbsp;input/output&nbsp;direction&nbsp;of&nbsp;each&nbsp;bit&nbsp;(1&nbsp;is&nbsp;output,&nbsp;0&nbsp;is&nbsp;input).&nbsp;<br>
&nbsp;<br>
Returns&nbsp;MPSSE_OK&nbsp;on&nbsp;success.<br>
Raises&nbsp;an&nbsp;exception&nbsp;on&nbsp;failure.</tt></dd></dl>

<dl><dt><a name="MPSSE-SetLoopback"><strong>SetLoopback</strong></a>(self, enable)</dt><dd><tt>Enable&nbsp;/&nbsp;disable&nbsp;internal&nbsp;loopback.&nbsp;Loopback&nbsp;is&nbsp;disabled&nbsp;by&nbsp;default.<br>
&nbsp;<br>
@enable&nbsp;-&nbsp;Set&nbsp;to&nbsp;1&nbsp;to&nbsp;enable&nbsp;loopback,&nbsp;0&nbsp;to&nbsp;disable&nbsp;(disabled&nbsp;by&nbsp;default).<br>
&nbsp;<br>
Returns&nbsp;MPSSE_OK&nbsp;on&nbsp;success.<br>
Raises&nbsp;an&nbsp;exception&nbsp;on&nbsp;failure.</tt></dd></dl>

<dl><dt><a name="MPSSE-SetMode"><strong>SetMode</strong></a>(self, mode, endianess)</dt><dd><tt>Sets&nbsp;the&nbsp;appropriate&nbsp;transmit&nbsp;and&nbsp;receive&nbsp;commands&nbsp;based&nbsp;on&nbsp;the&nbsp;requested&nbsp;mode&nbsp;and&nbsp;byte&nbsp;order.<br>
Called&nbsp;internally&nbsp;by&nbsp;__init__&nbsp;and&nbsp;Open.<br>
&nbsp;<br>
@mode&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;The&nbsp;<a href="#MPSSE">MPSSE</a>&nbsp;mode&nbsp;to&nbsp;use,&nbsp;one&nbsp;of:&nbsp;SPI0,&nbsp;SPI1,&nbsp;SPI2,&nbsp;SPI3,&nbsp;I2C,&nbsp;GPIO,&nbsp;BITBANG.<br>
@endianess&nbsp;-&nbsp;The&nbsp;endianess&nbsp;of&nbsp;data&nbsp;transfers,&nbsp;one&nbsp;of:&nbsp;MSB,&nbsp;LSB.<br>
&nbsp;<br>
Returns&nbsp;MPSSE_OK&nbsp;on&nbsp;success.<br>
Raises&nbsp;an&nbsp;exception&nbsp;on&nbsp;failure.</tt></dd></dl>

<dl><dt><a name="MPSSE-Start"><strong>Start</strong></a>(self)</dt><dd><tt>Send&nbsp;data&nbsp;start&nbsp;condition.<br>
&nbsp;<br>
Returns&nbsp;MPSSE_OK&nbsp;on&nbsp;success.<br>
Raises&nbsp;an&nbsp;exception&nbsp;on&nbsp;failure.</tt></dd></dl>

<dl><dt><a name="MPSSE-Stop"><strong>Stop</strong></a>(self)</dt><dd><tt>Send&nbsp;data&nbsp;stop&nbsp;condition.<br>
&nbsp;<br>
Returns&nbsp;MPSSE_OK&nbsp;on&nbsp;success.<br>
Raises&nbsp;an&nbsp;exception&nbsp;on&nbsp;failure.</tt></dd></dl>

<dl><dt><a name="MPSSE-Transfer"><strong>Transfer</strong></a>(self, data)</dt><dd><tt>Transfers&nbsp;data&nbsp;over&nbsp;the&nbsp;selected&nbsp;serial&nbsp;protocol.<br>
For&nbsp;use&nbsp;only&nbsp;in&nbsp;SPI0,&nbsp;SPI1,&nbsp;SPI2,&nbsp;SPI3&nbsp;modes.<br>
&nbsp;<br>
@data&nbsp;-&nbsp;A&nbsp;string&nbsp;of&nbsp;bytes&nbsp;to&nbsp;be&nbsp;written.<br>
&nbsp;<br>
Returns&nbsp;a&nbsp;string&nbsp;of&nbsp;len(data)&nbsp;bytes.</tt></dd></dl>

<dl><dt><a name="MPSSE-Tristate"><strong>Tristate</strong></a>(self)</dt><dd><tt>Puts&nbsp;all&nbsp;I/O&nbsp;pins&nbsp;into&nbsp;a&nbsp;tristate&nbsp;mode&nbsp;(FT232H&nbsp;only).</tt></dd></dl>

<dl><dt><a name="MPSSE-Version"><strong>Version</strong></a>(self)</dt><dd><tt>Returns&nbsp;the&nbsp;libmpsse&nbsp;version&nbsp;number.<br>
High&nbsp;nibble&nbsp;is&nbsp;major,&nbsp;low&nbsp;nibble&nbsp;is&nbsp;minor.</tt></dd></dl>

<dl><dt><a name="MPSSE-Write"><strong>Write</strong></a>(self, data)</dt><dd><tt>Writes&nbsp;bytes&nbsp;out&nbsp;via&nbsp;the&nbsp;selected&nbsp;serial&nbsp;protocol.<br>
&nbsp;<br>
@data&nbsp;-&nbsp;A&nbsp;string&nbsp;of&nbsp;bytes&nbsp;to&nbsp;be&nbsp;written.<br>
&nbsp;<br>
Returns&nbsp;MPSSE_OK&nbsp;on&nbsp;success.<br>
Raises&nbsp;an&nbsp;exception&nbsp;on&nbsp;failure.</tt></dd></dl>

<dl><dt><a name="MPSSE-WriteBits"><strong>WriteBits</strong></a>(self, bits, n)</dt><dd><tt>Performs&nbsp;a&nbsp;bitwise&nbsp;write&nbsp;of&nbsp;up&nbsp;to&nbsp;8&nbsp;bits&nbsp;at&nbsp;a&nbsp;time.<br>
&nbsp;<br>
@bits&nbsp;-&nbsp;An&nbsp;integer&nbsp;of&nbsp;bits&nbsp;to&nbsp;be&nbsp;written.<br>
@n&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;Transmit&nbsp;n&nbsp;number&nbsp;of&nbsp;least-significant&nbsp;bits.<br>
&nbsp;<br>
Returns&nbsp;MPSSE_OK&nbsp;on&nbsp;success.<br>
Raises&nbsp;an&nbsp;exception&nbsp;on&nbsp;failure.</tt></dd></dl>

<dl><dt><a name="MPSSE-WritePins"><strong>WritePins</strong></a>(self, data)</dt><dd><tt>Writes&nbsp;a&nbsp;new&nbsp;state&nbsp;to&nbsp;the&nbsp;chip's&nbsp;pins.<br>
For&nbsp;use&nbsp;in&nbsp;BITBANG&nbsp;mode&nbsp;only.<br>
&nbsp;<br>
@data&nbsp;-&nbsp;An&nbsp;integer&nbsp;with&nbsp;the&nbsp;bits&nbsp;set&nbsp;to&nbsp;the&nbsp;desired&nbsp;pin&nbsp;states&nbsp;(1&nbsp;=&nbsp;output,&nbsp;0&nbsp;=&nbsp;input).<br>
&nbsp;<br>
Returns&nbsp;MPSSE_OK&nbsp;on&nbsp;success.<br>
Raises&nbsp;an&nbsp;exception&nbsp;on&nbsp;failure.</tt></dd></dl>

</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>ACK</strong> = 0<br>
<strong>BITBANG</strong> = 7<br>
<strong>FIFTEEN_MHZ</strong> = 15000000<br>
<strong>FIVE_MHZ</strong> = 5000000<br>
<strong>FOUR_HUNDRED_KHZ</strong> = 400000<br>
<strong>GPIO</strong> = 6<br>
<strong>GPIOH0</strong> = 4<br>
<strong>GPIOH1</strong> = 5<br>
<strong>GPIOH2</strong> = 6<br>
<strong>GPIOH3</strong> = 7<br>
<strong>GPIOH4</strong> = 8<br>
<strong>GPIOH5</strong> = 9<br>
<strong>GPIOH6</strong> = 10<br>
<strong>GPIOH7</strong> = 11<br>
<strong>GPIOL0</strong> = 0<br>
<strong>GPIOL1</strong> = 1<br>
<strong>GPIOL2</strong> = 2<br>
<strong>GPIOL3</strong> = 3<br>
<strong>I2C</strong> = 5<br>
<strong>IFACE_A</strong> = 1<br>
<strong>IFACE_ANY</strong> = 0<br>
<strong>IFACE_B</strong> = 2<br>
<strong>IFACE_C</strong> = 3<br>
<strong>IFACE_D</strong> = 4<br>
<strong>LSB</strong> = 8<br>
<strong>MPSSE_FAIL</strong> = -1<br>
<strong>MPSSE_OK</strong> = 0<br>
<strong>MSB</strong> = 0<br>
<strong>NACK</strong> = 1<br>
<strong>ONE_HUNDRED_KHZ</strong> = 100000<br>
<strong>ONE_MHZ</strong> = 1000000<br>
<strong>SIX_MHZ</strong> = 6000000<br>
<strong>SPI0</strong> = 1<br>
<strong>SPI1</strong> = 2<br>
<strong>SPI2</strong> = 3<br>
<strong>SPI3</strong> = 4<br>
<strong>TEN_MHZ</strong> = 10000000<br>
<strong>THIRTY_MHZ</strong> = 30000000<br>
<strong>TWELVE_MHZ</strong> = 12000000<br>
<strong>TWO_MHZ</strong> = 2000000</td></tr></table>
</body></html>
